import { $put } from '@js/request'
import moment, { Moment } from 'moment'

// 更新配置
export async function updateConfigRequest (d: { [k: string]: any }): Promise<void> {
  const id: string = d.id
  delete d.id
  if (d.effective_datetime instanceof moment) {
    d.effective_datetime = Math.floor((d.effective_datetime as Moment).valueOf() / 1000)
  }
  const res = await $put(`/api/commission/procedure/${id}`, d)
  return res.data
}
